<template>
	<view>
		<uni-list>
<!--			<uni-list-item title="微信自动登录"  :show-switch="true" :switchChecked="wxLoginAuto"  @switchChange="setWxLoginAuto" />-->
			<uni-list-item title="清理缓存" @click="clearDictStorage" clickable/>
		</uni-list>
	</view>
</template>

<script>
	import verification from "../../utils/verification";

	export default {
	    computed:{
		},
		data() {
			return {
                wxLoginAuto:false
			};
		},
		onLoad(){
            this.loadWxLoginAuto()
		},
		methods:{
            setWxLoginAuto(){
                uni.setStorageSync('wxLoginAuto',!this.wxLoginAuto)
				this.loadWxLoginAuto()
			},
			clearDictStorage() {
				uni.getStorageInfo({
					success: res => {
						console.log(res.keys);
						if (res.keys) {
							res.keys.forEach(key => {
								if (verification.startWith(key, 'dict_')) {
									uni.removeStorageSync(key)
								}
							})
						}
						uni.showToast({
							icon: 'none',
							title: '清理成功'
						})
					}
				})
			}
		},
		watch:{
		}
	}
</script>

<style>

</style>
